<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="wf" uri="/augurit-wf"%>
 <%@page import="com.augurit.common.system.web.auth.form.LoginUserForm"%>
 <%LoginUserForm form=(LoginUserForm)request.getSession().getAttribute("SES_LOGIN_USER"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- dwr libs -->
<%@ include file="/smartform/public/meta_smartform.jsp"%>
<%@ include file="/smartform/public/meta_smartform_ext.jsp"%>
<%@ include file="/smartform/public/meta_smartform_wf.jsp"%>
<%@ include file="/smartform/public/meta_smartform_oa.jsp"%>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/resources/components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<!-- 打印 -->
<script language="JavaScript" src="${ctx}/resources/components/ntko/OfficeContorlFunctions.js"></script>
<script language="JavaScript" src="${ctx}/wf/client/common/js/wf-attachment-public.js"></script>

<script>

function writeJudgmentyq(index) {
    var divid = '';
    switch(index) {
        case 'A': divid = 'jbrJudgmentYQ'; break;
        case 'E': divid = 'deptJudgmentYQ'; break;
        case 'F': divid = 'leadershipJudgmentYQ'; break;
    }
    var divobj = document.getElementById(divid);
    if (divid == '' || !divobj) {
        alert('参数错误！');
        return;
    }
   var tiDbId = parent.WF_CONFIG.taskInstDbid
    var win = new Ext.ux.wf.WfOpinionWin({
        taskInstDbid: tiDbId
    });
    win.show();
    win.on('complete', function (opinion) {
    changeOpinion(opinion, divobj);    
  });
}

function inputJudgmentyq(index) {
    var divid = '', inputid = '';
    switch(index) {
        case 'A': divid = 'jbrJudgmentYQ'; inputid = 'jbrJudgmentTxt_yq'; break;
        case 'E': divid = 'deptJudgmentYQ'; inputid = 'deptJudgmentTxt_yq'; break;
        case 'F': divid = 'leadershipJudgmentYQ'; inputid = 'leadershipJudgmentTxt_yq'; break;
    }
    var divobj = document.getElementById(divid);
    var inputobj = document.getElementById(inputid);
    if (divid == '' || !divobj) {
        alert('参数错误！');
        return;
    }

    if (inputobj.value == '') { alert('请输入意见!'); return; }

    Ext.Ajax.request({
      method:'post',
      url:'${ctx}/wf!saveTaskOpinion.action',
      params:{
        'instance.taskInstDbid': parent.WF_CONFIG.taskInstDbid,
        'instance.handleComments': inputobj.value
      },
      success:function(){
      changeOpinion(inputobj.value, divobj);
        inputobj.value = '';
      },
      scope:this
    });
}

function changeOpinion(opinion, divobj) {
  var userOpinion = document.getElementById('userOpinion');
  if (userOpinion) {
    userOpinion.innerHTML = opinion + '<br>&nbsp;&nbsp;&nbsp;&nbsp;${CurrUserName}&nbsp;&nbsp;' + getNowDate();
  } else {
    divobj.style.color = '#009966';
    divobj.innerHTML = opinion + '<br>&nbsp;&nbsp;&nbsp;&nbsp;${CurrUserName}&nbsp;&nbsp;' + getNowDate();
  }
}


function getNowDate(){
	var date=new Date();
	var month=date.getMonth() + 1;
	var year=date.getFullYear();
	var day=date.getDate();
	var hours=date.getHours(); 
	var m=date.getMinutes(); 
	var s=date.getSeconds();
	if(month<10){
	   month="0"+month;
	}
	if(day<10){
	  day="0"+day;
	}
 return year+"-"+month+"-"+day+" "+hours+":"+m+":"+s;
}

</script>
<body align="center">
<form action="" method="post" >
<table width="700" border="0" cellspacing="2" align="center" cellpadding="2">
	<tr>
		<td>
			<table width="100%" border="0" cellspacing="2" cellpadding="2">
				<tr>
					<td height="55" bordercolor="#000000" align="center"
						style="font-size: 22px;">
						<br />
						<b>广州市城市管理委员会行政许可延期决定审批表</b>
						<br />
						<br />
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="1" cellspacing="0" cellpadding="2"
				class="tpl_list_ui">
				<tr>
					<td width="10%" height="0"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
					<td width="10%"></td>
				</tr>
				<tr>
					<td bordercolor="#000000" colspan="2" height="25" align="center">
						行政许可事项
					</td>
					<td colspan="4" bordercolor="#000000"
						style="padding: 1px 1px 1px 1px;">
						<input name="cbyw_" value="${cbyw}" type="text" style="width: 100%"
							class="readonly_cls" readonly />
					</td>
					<td bordercolor="#000000" colspan="2" height="25" align="center">
						行政许可受理时间
					</td>
					<td colspan="2" bordercolor="#000000"
						style="padding: 1px 1px 1px 1px;">
						<input name="sarqYQ"
							value="<s:date name='sqrq' format="yyyy年MM月dd日"/>" type="text"
							style="width: 100%" class="readonly_cls" readonly />
					</td>
				</tr>
				<tr>
					<td bordercolor="#000000" colspan="2" height="25" align="center">
						申请单位
					</td>
					<td colspan="8" bordercolor="#000000"
						style="padding: 1px 1px 1px 1px;">
						<input id="sqdw_" name="sqdw_" value="${sqdw}" type="text"
							style="width: 100%" class="readonly_cls" readonly />
					</td>
				</tr>
		
				<tr>
					<td bordercolor="#000000" colspan="2" height="25" align="center">
						延期天数(最多10天)
					</td>
					<td colspan="8" bordercolor="#000000" style="padding: 1px 1px 1px 1px;">
						<input id="yqts" name="yqts" value="${yqts}" type="text" style="width: 30%" class="text" 
						 onkeyup="javascript:this.value=this.value.replace(/[^\d]/g,'');if(this.value<0){ this.value=0;};" 
						 onchange="javascript:this.value=this.value.replace(/[^\d]/g,'');if(this.value<0){ this.value=0;};" />
						 天<font color="red">&nbsp;&nbsp;(大于或等于0,小于或等于10)</font>
						
						
					</td>
				</tr>
				<!-- 
				<tr>
					<td bordercolor="#000000" colspan="2" height="100" align="center">
						延期决定的理由
					</td>
					<td colspan="8" bordercolor="#000000"
						style="padding: 1px 1px 1px 1px;">
					<textarea class="text" rows="8"  name="ssgdyqly">${ssgdyqly}</textarea>	
							
					</td>
				</tr>
				 -->
				<tr>
                  <td bordercolor="#000000" colspan="2" height="200" align="center">经办人意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:150px;">
                    <wf:opinion activities="jbryqyj,jbrcs,txyjjbr" name="opinions_jbr"/>
                    <div id="jbrJudgmentYQ"></div>
                    </div>
                    <wf:textarea id="jbrJudgmentTxt_yq" name="jbrJudgmentTxt_yq" rows="3" cols="150" style="width:100%">${jbrJudgmentTxt_yq}</wf:textarea> 
                    <wf:input type="button" name="jbrBtn_yq" id="jbrBtn_yq" value="填写意见" cssClass="tpl_ui_btn" onclick="inputJudgmentyq('A');" />
                    <wf:input type="button" name="jbrJudgment_yq" id="jbrJudgment_yq" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgmentyq('A');" />
                  </td>
                </tr>
				
				<tr>
                  <td bordercolor="#000000" colspan="2" height="150" align="center">承办处室意见</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:150px;">
                    <wf:opinion activities="czgldyqsh,cldyqsh,cldyjtx" name="opinions_dept"/>
                    <div id="deptJudgmentYQ"></div>
                    </div>
                    <wf:textarea id="deptJudgmentTxt_yq" name="deptJudgmentTxt_yq" rows="3" cols="150" style="width:100%">${deptJudgmentTxt_yq}</wf:textarea>
                    <wf:input type="button" name="deptBtn_yq" id="deptBtn_yq" value="快速填写" cssClass="tpl_ui_btn" onclick="inputJudgmentyq('E');" />
                    <wf:input type="button" name="deptJudgment_yq" id="deptJudgment_yq" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgmentyq('E');" />
                  </td>
                </tr>
				
				<tr>
                  <td bordercolor="#000000" colspan="2" height="150" align="center">委领导批示</td>
                  <td colspan="8" bordercolor="#000000" style="padding:1px 1px 1px 1px;">
                    <div style="padding:5px 5px 5px 5px;height:170px;">
                    <wf:opinion activities="wfgldyqsp,wzgldyqsh,wldyjtx,wfgldyqsh" name="opinions_leadership"/>
                    <div id="leadershipJudgmentYQ"></div>
                    </div>
                    <wf:textarea id="leadershipJudgmentTxt_yq" name="leadershipJudgmentTxt_yq" rows="3" cols="150" style="width:100%">${leadershipJudgmentTxt_yq}</wf:textarea>
                    <wf:input type="button" name="leadershipBtn_yq" id="leadershipBtn_yq" value="快速填写" cssClass="tpl_ui_btn" onclick="inputJudgmentyq('F');" />
                    <wf:input type="button" name="leadershipJudgment_yq" id="leadershipJudgment_yq" value="常用意见" cssClass="tpl_ui_btn" onclick="writeJudgmentyq('F');" />
                  </td>
                </tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			&nbsp;

		</td>
	</tr>
	<tr>
		<td>
			&nbsp;

		</td>
	</tr>
</table>
</form>
</body>
</html>